local path "C:\Users\pgi1\Dropbox\Coal 2021 _ Joe Peter\Bank Regressions\"
cd "`path'\data"
set seed 100
set more off
clear



  
////////////////////////////////////////////////////////////////
// Tabulate stories
  
use news-bank-data, clear

bysort pubid: keep if _n==1

gen national=regexm(Publication,"New York Times") | regexm(Publication,"Guardian")  | regexm(Publication,"Financial Times")

gen local=regexm(Publication,"Times-Tribune") |  regexm(Publication,"Pittsburgh Post-Gazette") |  regexm(Publication,"Pittsburgh Tribune Review") |  regexm(Publication,"Charleston Gazette")

gen x=1
gen year=year(Date)


collapse (sum) x national local, by(year)

keep if year<=2020

// add zero observation pre 2006
append using year-2000-2006.dta
sort year

gen year1=year-0.2
gen year2=year+0.2

twoway  (bar  x year1, barw(0.3) fcolor(green) lcolor(black)) /// 
(bar   national year, barw(0.3) fcolor(blue) lcolor(black)) /// 
(bar   local year2, barw(0.3) fcolor(red) lcolor(black)) ///
 ,scheme(s2mono) graphregion(fcolor(white)) bgcolor(white)  xlabel(2000(2)2020) ytitle("Number of Stories") ///
ylabel(0 (10) 40, nogrid ) yline(0 (10) 40, lpattern(shortdash) lcolor(gs10) lwidth(thin)) ///
legend( row(2) order(1 2 3) lab(1 "Any") lab(2 "National Newspaper") lab(3 "Local Newspaper")  )  ysize(3.75) xsize(5)
 
graph export  "`path'\figures\figure4.emf", as(emf) replace    

  exit
twoway (scatter   national year, connect(l) lpattern(solid) msymbol(O) color(green)  lwidth(medthick)) /// 
(scatter   local year, connect(l) lpattern(solid) msymbol(O) color(blue)  lwidth(medthick)) ///
 (scatter  x year, connect(l) lpattern(solid) msymbol(O) color(red)  lwidth(medthick)) /// 
 ,scheme(s2mono) graphregion(fcolor(white)) bgcolor(white)  xlabel(2000(2)2020) xtitle("Year") ytitle("Number of Stories") ///
 ylabel(0 (10) 40, nogrid ) yline(0 (10) 40, lpattern(shortdash) lcolor(gs10) lwidth(thin)) ///
 legend( row(2) order(1 2 3) lab(1 "National Newspaper") lab(2 "Local Newspaper") lab(3 "Any") )  ysize(3.75) xsize(5)